package com.sam.im.heiqun.uis.fragments;

import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.sam.im.heiqun.R;

import org.webrtc.VideoRenderer;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by leijiawen on 2017/7/31.
 */

public class PushFragment extends Fragment {
    @BindView(R.id.myVideo)
    public GLSurfaceView myVideoView;
    Unbinder unbinder;
    public VideoRenderer.Callbacks localRender;
    @BindView(R.id.tb_switch)
    ImageView tbSwitch;
    private int vWidth = 100;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.layout_push_fragment, container, false);
        unbinder = ButterKnife.bind(this, view);
        myVideoView.setPreserveEGLContextOnPause(true);
        myVideoView.setKeepScreenOn(true);
       /* VideoRendererGui.setView(myVideoView, new Runnable() {
            @Override
            public void run() {
                Log.i("info","===111===");
            }
        });
        localRender = VideoRendererGui.createGuiRenderer(0, 0,
                vWidth, vWidth, RendererCommon.ScalingType.SCALE_ASPECT_FILL, false);*/
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick(R.id.tb_switch)
    public void onViewClicked() {

    }
}
